C program to make the sum of diagonal elements of a matrix